// import 'babel-polyfill'
import Vue from 'vue'
import entry from './App.vue'
import router from './router'
import VueI18n from 'vue-i18n'

import '../styles/index.less'
import shscUI from '../src/index'
// 组件库中的语言
import en from '../lib/locale/lang/en'
import zh from '../lib/locale/lang/zh-cn'
// 本项目中的语言
import enLocal from './views/locale/en'
import zhLocal from './views/locale/zh-cn'
// 代码高亮
import Highlight from './assets/js/highlight'

Vue.use(Highlight)

Vue.use(VueI18n)
Vue.use(shscUI)
Vue.locale = () => {}

// eslint-disable-next-line new-cap
const scui = new shscUI.init({
  size: 'middle'
})

const messages = {
  en: Object.assign(enLocal, en),
  zh: Object.assign(zhLocal, zh)
}
const i18n = new VueI18n({
  locale: 'zh', // set locale
  messages // set locale messages
})

Vue.config.productionTip = false

new Vue({
  scui,
  i18n,
  router,
  render: h => h(entry)
}).$mount('#app')
